<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />

		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />

		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />

		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>

		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>

		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.btn_regist').click(function(){
				if( confirm('登録してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});

			$('.btn_update').click(function(){
				if( confirm('更新してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});

			$('.btn_return').click(function(){
				location.href = "mcost_flier_index.php?hist=2";
			});
		});
		</script>

	</head>
	<body id="">
{{ $menu }}
{{ $logout }}
		<div id="container"><div class="wrapper">
			<h2>チラシ経費管理</h2>
			<ul class="submenu clearfix">
				<li>経費一覧・更新</li>
				<li><a href="mcost_flier_import.php">経費一括登録</a></li>
				<li><a href="mcost_flier_price.php">チラシ単価マスタ</a></li>
			</ul>
			<h3>チラシ経費情報{{ if $forms.id == '' }}登録{{ else }}更新{{ /if }}{{ if $phase == 'complete' }}完了{{ /if }}</h3>
{{ if $phase == 'input' }}
			<p class="message">内容を確認し、{{ if $forms.id == '' }}登録{{ else }}更新{{ /if }}ボタンをクリックしてください。</p>
			<form name="fm" action="mcost_flier_form.php" method="post">
				<table class="formTable">
					<tbody>
{{ if $forms.id != '' }}
						<tr>
							<th>更新日</th>
							<td>
								{{ $forms.u_time|date_format:"%Y/%m/%d %H:%M" }}<input type="hidden" name="u_time" value="{{ $forms.u_time }}" />
							</td>
						</tr>
						<tr>
							<th>更新者</th>
							<td>
								{{ $forms.m_user_name }}<input type="hidden" name="m_user_name" value="{{ $forms.m_user_name }}" />
							</td>
						</tr>
						<tr>
							<th>週名</th>
							<td>
								{{ $forms.weekname }}
							</td>
						</tr>
						<tr>
							<th>ID</th>
							<td>
								{{ $forms.id }}

							</td>
						</tr>
{{ /if }}
						<tr>
							<th>店舗コード</th>
							<td>
								<input type="text" name="shop_cd" class="dtext" value="{{ $forms.shop_cd|escape }}"  maxlangth="100"  readonly/>
							</td>
						</tr>
						<tr>
							<th>店名</th>
							<td>
								<input type="ｄtext" name="shop_name" class="dtext" value="{{ $forms.shop_name|escape }}"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th>チラシ経費<br>本年（見込）</th>
							<td>
								<input type="ｄtext" name="now_cost" class="dtext" value="{{ $forms.now_cost|number_format:2 }}"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th style="width:150px;">※チラシ経費　計画</th>
							<td>
								<input type="text" name="plane_cost" class="text" value="{{ $forms.plane_cost }}"  maxlangth="100"  />{{ $err.plane_cost }}
							</td>
						</tr><tr>
							<th>チラシ経費前年</th>
							<td>
								<input type="ｄtext" name="last_cost" class="dtext" value="{{ $forms.last_cost|number_format:2  }}"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th style="width:130px;">チラシ経費計画比</th>
							<td>
								<input type="ｄtext" name="plane_rate" class="dtext" value="{{ $forms.plane_rate|number_format:2 }}%"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th style="width:143px;">チラシ経費計画差異</th>
							<td>
								<input type="ｄtext" name="plane_inc" class="dtext" value="{{ $forms.plane_inc|number_format:2  }}"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th style="width:130px;">チラシ経費前年比</th>
							<td>
								<input type="ｄtext" name="last_rate" class="dtext" value="{{ $forms.last_rate|number_format:2 }}%"  maxlangth="100"  readonly/>
							</td>
						</tr><tr>
							<th style="width:143px;">チラシ経費前年差異</th>
							<td>
								<input type="ｄtext" name="last_inc" class="dtext" value="{{ $forms.last_inc|number_format:2  }}"  maxlangth="100"  readonly/>
							</td>
						</tr>

					</tbody>
				</table>
				<p class="button">
				<button type="button" class="btn_return" class="submit"><span>戻る</span></button>
{{ if $forms.id != '' }}
					<button type="button" class="btn_update" class="submit"><span>更新</span></button>
{{ else }}
					<button type="button" class="btn_regist" class="submit"><span>登録</span></button>
{{ /if }}
				</p>
				<input type="hidden" name="matrix_cd" value="{{ $forms.matrix_cd|escape }}" />
				<input type="hidden" name="id" value="{{ $forms.id }}" />
				<input type="hidden" name="mode" value="" />
			</form>
<div id="dialog" >
</div>
{{ /if }}
{{ if $phase == 'complete' }}
			<p class="message">{{ $message }}</p>
			<ul>
				<li>>> <a href="mcost_flier_index.php?hist=2">一覧ページに戻る</a></li>
				<li>>> <a href="mcost_flier_form.php?id={{ $forms.shop_cd }}&m={{$forms.matrix_cd}}">更新</a></li>
			</ul>
{{ /if }}

		</div></div>
		{{ $footer }}
	</body>
</html>